home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / newrouts / newrouts.frm (.txt) < prev    next >
Visual Basic Form  |  1997-06-13  |  16KB  |  498 lines

  1. VERSION 4.00
  2. Begin VB.Form frmNewRouts 
  3.    Caption         =   "Add a new Routine"
  4.    ClientHeight    =   3285
  5.    ClientLeft      =   3540
  6.    ClientTop       =   1905
  7.    ClientWidth     =   4935
  8.    Height          =   3975
  9.    Icon            =   "NewRouts.frx":0000
  10.    Left            =   3480
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    ScaleHeight     =   3285
  14.    ScaleWidth      =   4935
  15.    Top             =   1275
  16.    Width           =   5055
  17.    Begin VB.Frame Frame1 
  18.       Height          =   420
  19.       Left            =   30
  20.       TabIndex        =   15
  21.       Top             =   0
  22.       Width           =   4875
  23.       Begin VB.OptionButton optSub 
  24.          Caption         =   "&Sub Procedure"
  25.          Height          =   225
  26.          Left            =   90
  27.          TabIndex        =   17
  28.          Top             =   135
  29.          Value           =   -1  'True
  30.          Width           =   2055
  31.       End
  32.       Begin VB.OptionButton optFunction 
  33.          Caption         =   "F&unction"
  34.          Height          =   195
  35.          Left            =   3135
  36.          TabIndex        =   16
  37.          Top             =   150
  38.          Width           =   1455
  39.       End
  40.    End
  41.    Begin VB.TextBox txtMaxLen 
  42.       BeginProperty Font 
  43.          name            =   "Fixedsys"
  44.          charset         =   0
  45.          weight          =   400
  46.          size            =   9
  47.          underline       =   0   'False
  48.          italic          =   0   'False
  49.          strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   330
  52.       Left            =   105
  53.       TabIndex        =   8
  54.       Top             =   2925
  55.       Visible         =   0   'False
  56.       Width           =   495
  57.    End
  58.    Begin VB.TextBox txtSinNum 
  59.       BeginProperty Font 
  60.          name            =   "Fixedsys"
  61.          charset         =   0
  62.          weight          =   400
  63.          size            =   9
  64.          underline       =   0   'False
  65.          italic          =   0   'False
  66.          strikethrough   =   0   'False
  67.       EndProperty
  68.       Height          =   330
  69.       Left            =   3465
  70.       TabIndex        =   4
  71.       Top             =   2430
  72.       Width           =   1305
  73.    End
  74.    Begin VB.TextBox txtProgName 
  75.       BeginProperty Font 
  76.          name            =   "Fixedsys"
  77.          charset         =   0
  78.          weight          =   400
  79.          size            =   9
  80.          underline       =   0   'False
  81.          italic          =   0   'False
  82.          strikethrough   =   0   'False
  83.       EndProperty
  84.       Height          =   330
  85.       Left            =   1110
  86.       TabIndex        =   1
  87.       Top             =   885
  88.       Width           =   3645
  89.    End
  90.    Begin VB.ComboBox cboRetType 
  91.       BeginProperty Font 
  92.          name            =   "Fixedsys"
  93.          charset         =   0
  94.          weight          =   400
  95.          size            =   9
  96.          underline       =   0   'False
  97.          italic          =   0   'False
  98.          strikethrough   =   0   'False
  99.       EndProperty
  100.       Height          =   345
  101.       ItemData        =   "NewRouts.frx":0442
  102.       Left            =   1110
  103.       List            =   "NewRouts.frx":0467
  104.       TabIndex        =   3
  105.       Top             =   2430
  106.       Width           =   1275
  107.    End
  108.    Begin VB.CommandButton cmdAddVariable 
  109.       Caption         =   "Add &Parameters ..."
  110.       Height          =   345
  111.       Left            =   3360
  112.       TabIndex        =   5
  113.       Top             =   2820
  114.       Width           =   1470
  115.    End
  116.    Begin VB.CommandButton cmdAbort 
  117.       Caption         =   "&Abort Build"
  118.       Height          =   345
  119.       Left            =   2280
  120.       TabIndex        =   7
  121.       Top             =   2835
  122.       Width           =   1020
  123.    End
  124.    Begin VB.CommandButton cmdBuild 
  125.       Caption         =   "&Build Routine"
  126.       Height          =   330
  127.       Left            =   1110
  128.       TabIndex        =   6
  129.       Top             =   2850
  130.       Width           =   1125
  131.    End
  132.    Begin VB.TextBox txtDesc 
  133.       BeginProperty Font 
  134.          name            =   "Fixedsys"
  135.          charset         =   0
  136.          weight          =   400
  137.          size            =   9
  138.          underline       =   0   'False
  139.          italic          =   0   'False
  140.          strikethrough   =   0   'False
  141.       EndProperty
  142.       Height          =   1065
  143.       Left            =   1110
  144.       MultiLine       =   -1  'True
  145.       TabIndex        =   2
  146.       Top             =   1305
  147.       Width           =   3645
  148.    End
  149.    Begin VB.TextBox txtAuthor 
  150.       BeginProperty Font 
  151.          name            =   "Fixedsys"
  152.          charset         =   0
  153.          weight          =   400
  154.          size            =   9
  155.          underline       =   0   'False
  156.          italic          =   0   'False
  157.          strikethrough   =   0   'False
  158.       EndProperty
  159.       Height          =   330
  160.       Left            =   1110
  161.       TabIndex        =   0
  162.       Top             =   510
  163.       Width           =   3645
  164.    End
  165.    Begin VB.Label Label6 
  166.       Caption         =   "Sin# (if any) :"
  167.       Height          =   285
  168.       Left            =   2565
  169.       TabIndex        =   14
  170.       Top             =   2445
  171.       Width           =   885
  172.    End
  173.    Begin VB.Label Label5 
  174.       Caption         =   "Function"
  175.       Height          =   225
  176.       Left            =   75
  177.       TabIndex        =   13
  178.       Top             =   2250
  179.       Width           =   855
  180.    End
  181.    Begin VB.Label Label4 
  182.       Caption         =   "Routine Name:"
  183.       Height          =   390
  184.       Left            =   45
  185.       TabIndex        =   12
  186.       Top             =   885
  187.       Width           =   975
  188.    End
  189.    Begin VB.Label Label3 
  190.       Caption         =   "Return Type :"
  191.       Height          =   300
  192.       Left            =   75
  193.       TabIndex        =   11
  194.       Top             =   2445
  195.       Width           =   1065
  196.    End
  197.    Begin VB.Label Label2 
  198.       Caption         =   "Description :"
  199.       Height          =   345
  200.       Left            =   75
  201.       TabIndex        =   10
  202.       Top             =   1305
  203.       Width           =   990
  204.    End
  205.    Begin VB.Label Label1 
  206.       Caption         =   "Author :"
  207.       Height          =   255
  208.       Left            =   60
  209.       TabIndex        =   9
  210.       Top             =   480
  211.       Width           =   1050
  212.    End
  213.    Begin VB.Menu mnFile 
  214.       Caption         =   "&File"
  215.       Begin VB.Menu mnExit 
  216.          Caption         =   "&Exit"
  217.       End
  218.    End
  219.    Begin VB.Menu mnHelp 
  220.       Caption         =   "&Help"
  221.       Begin VB.Menu mnAbout 
  222.          Caption         =   "&About"
  223.       End
  224.    End
  225. Attribute VB_Name = "frmNewRouts"
  226. Attribute VB_Creatable = False
  227. Attribute VB_Exposed = False
  228. Dim retcode&
  229. Private Sub cmdAbort_Click()
  230.     ResetScr
  231.     Unload Me
  232. End Sub
  233. Private Sub cmdAddVariable_Click()
  234.     Dim ub%, i%
  235.     On Error GoTo Loadfrm
  236.     ub% = UBound(gParms())
  237.     On Error GoTo 0
  238.     For i = 0 To ub%
  239.         frmAddVariables.lstVars.AddItem gParms(i)
  240.     Next i
  241. Loadfrm:
  242.     frmAddVariables.Show vbModal
  243. End Sub
  244. Sub BuildRoutine()
  245.     '**************************************
  246.     '* Author : Michael J. Cox
  247.     '* Date : 6/13/97
  248.     '* Email : mikec247@ix.netcom.com
  249.     '*
  250.     '* Desc:
  251.     '*   This routine does all the work.
  252.     '*   It builds a temporary ascii file and
  253.     '*   then load it into the active form.
  254.     '*
  255.     '*   Modify this routine to customize the
  256.     '*   new routine template.
  257.     '***********************************
  258.     On Error GoTo BuildRoutineErr
  259.     Dim CurForm As Object, maxlen%
  260.     Dim i%, nFileHnd%, dSub$, dDate$, oldtext$
  261.     Dim dArgs$, dParmsDesc$(), dParms$()
  262.     Dim dTab$, tParms%, dRetType$
  263.     dDate = Date
  264.     dTab$ = Space(4)
  265.     maxlen% = gMaxLen%
  266.     Set CurForm = gobjVBInst.ActiveProject.ActiveForm
  267.     On Error GoTo noParms
  268.     tParms% = UBound(gParms()) + 1
  269. noParms:
  270.     On Error GoTo BuildRoutineErr
  271.     nFileHnd = FreeFile
  272.     Open App.Path & "\Routine.txt" For Output As nFileHnd
  273.     If gIsFunction And (cboRetType.Text) <> "" Then
  274.         dSub$ = "Function "
  275.         dRetType$ = " As " & Trim(cboRetType.Text)
  276.     Else
  277.         dSub$ = "Sub "
  278.         dRetType$ = ""
  279.     End If
  280.